package com.myy.auth.controller;

import com.myy.auth.service.RoleService;
import com.myy.auth.vo.RoleVo;
import com.myy.common.result.Result;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 角色接口
 */
@AllArgsConstructor
@RestController
@RequestMapping("role")
public class RoleController {
    private final RoleService roleService;

    /**
     * 创建角色
     * @param roleVo
     * @return
     */
    @PostMapping("save")
    public Result<String> createRole(@Valid @RequestBody RoleVo roleVo) {
        String roleId = roleService.createRole(roleVo);
        return Result.success(roleId);
    }

    //页面信息：1、角色基本信息   2、项目列表[SysSystemControler中]   3、菜单结构[SysMenuControler中]
}
